package com.udaos.modules.api.filter;

import org.nutz.json.JsonFormat;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.ActionContext;
import org.nutz.mvc.ActionFilter;
import org.nutz.mvc.View;
import org.nutz.mvc.view.UTF8JsonView;

import com.udaos.common.base.Result;

/**
 * api拦截器
 * @author Administrator
 *
 */
public class ApiFilter implements ActionFilter {

	private static final Log log = Logs.get();

	public View match(ActionContext context) {
		//获取请求url
		String url=context.getRequest().getRequestURI();
		System.out.println("打印输出》》》》》》》》》》》："+url);
		if(2==1){
			 return new UTF8JsonView(JsonFormat.compact()).setData(Result.error(-1,"token invalid"));
		}
		return null;
	}

}
